import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  {
    path: '/',
    component: () => import('../views/main.vue'), //懒加载方式配置
    children: [{
      path: '/welcome',
      component: () => import('../views/main/welcome')
    },{
      path: 'base/',
      children: [
        {
          path: 'station',
          component: () => import('../views/main/base/station')
        },{
          path: 'train',
          component: () => import('../views/main/base/train')
        },{
          path: 'train-station',
          component: () => import('../views/main/base/train-station')
        },{
          path: 'train-carriage',
          component: () => import('../views/main/base/train-carriage')
        },{
          path: 'train-seat',
          component: () => import('../views/main/base/train-seat')
        }
      ]
    },{
      path: 'business/',
      children: [
       {
          path: 'daily-train',
          component: () => import('../views/main/business/daily-train.vue')
        },{
          path: 'daily-train-station',
          component: () => import('../views/main/business/daily-train-station.vue')
        },{
          path: 'daily-train-carriage',
          component: () => import('../views/main/business/daily-train-carriage.vue')
        },{
          path: 'daily-train-seat',
          component: () => import('../views/main/business/daily-train-seat.vue')
        },{
          path: 'daily-train-ticket',
          component: () => import('../views/main/business/daily-train-ticket.vue')
        },{
          path: 'confirm-order',
          component: () => import('../views/main/business/confirm-order.vue')
        },
      ]
    },{
      path: 'member/',
      children: [
       {
          path: 'ticket',
          component: () => import('../views/main/ticket.vue')
        },
      ]
    },{
      path: '/about',
      component: () => import('../views/main/about')
    },{
      path: 'batch/',
      children: [{
        path: 'job',
        component: () => import('../views/main/batch/job.vue')
      }]

    }]
  },
  {
    path: '',
    redirect: '/welcome'
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})


export default router
